\hypertarget{class_level_five}{
\section{LevelFive Class Reference}
\label{class_level_five}\index{LevelFive@{LevelFive}}
}


{\ttfamily \#include $<$levelFive.h$>$}\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_level_five_abbd9665cd046830beb552b2632d5c400}{LevelFive} (QGraphicsScene $\ast$theScene)
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
QRectF \hyperlink{class_level_five_ab9b179447ae7546beec7e7e9936e0178}{boundingRect} () const 
\item 
void \hyperlink{class_level_five_a128669075332c352f423e6e7892c9370}{paint} (QPainter $\ast$painter, const QStyleOptionGraphicsItem $\ast$option, QWidget $\ast$widget=0)
\item 
int \hyperlink{class_level_five_a15a3c882b6f2c4f645cd627e72cd7410}{generateRandomNumber} (int min, int max)
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{class_level_five_a49d0735f7e21868c1c128bd682cb60e0}{xPos}
\item 
int \hyperlink{class_level_five_aef7da49944f2c0192e80f54c427a5db9}{yPos}
\item 
\hyperlink{class_block}{Block} $\ast$ \hyperlink{class_level_five_acb6899f56afdf5b54ee0b078114dccdb}{block} \mbox{[}10\mbox{]}\mbox{[}25\mbox{]}
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\hyperlink{level_five_8cpp}{levelFive.cpp}

Creates the design for the fifth level. Uses the polymorphism feature of the \hyperlink{block_8cpp}{block.cpp} class and randomly generates blocks of different colors and places them in a pre-\/defined layout. Also places the mothership in the layout as part of the boss battle

Author: Natraj Subramanian 

Definition at line 18 of file levelFive.h.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_level_five_abbd9665cd046830beb552b2632d5c400}{
\index{LevelFive@{LevelFive}!LevelFive@{LevelFive}}
\index{LevelFive@{LevelFive}!LevelFive@{LevelFive}}
\subsubsection[{LevelFive}]{\setlength{\rightskip}{0pt plus 5cm}LevelFive::LevelFive (QGraphicsScene $\ast$ {\em theScene})}}
\label{class_level_five_abbd9665cd046830beb552b2632d5c400}


Definition at line 4 of file levelFive.cpp.


\begin{DoxyCode}
5 {
6     xPos = -380 + (BOUNDWIDTH - 25 * OUTLINEW)/4;
7     yPos = -630 + (BOUNDHEIGHT)/4;
8 
9     // Declare variable to hold seconds in clock
10     time_t seconds;
11     // Get value from system clock and place in seconds variable
12     time(&seconds);
13     // Convert seconds to a unsigned integer
14     srand((unsigned int) seconds);
15 
16     int detColor;
17 
18     // Create the layout for the level
19     for(int i = 0; i < 10; i++)
20     {
21         for(int j = 0; j < 25; j++)
22         {
23             if( (i > 1 && i < 8) && ( j > 3 && j < 21) )
24             {
25                  xPos += BLOCKW + SPACE;
26             }
27             else
28             {
29                 detColor = generateRandomNumber(0,5);
30 
31                 if(detColor == 0)
32                 {
33                     block[i][j] = new MonoBlock;
34                 }
35                 if(detColor == 1)
36                 {
37                     block[i][j] = new RedBlock;
38                 }
39                 if(detColor == 2)
40                 {
41                     block[i][j] = new GreenBlock;
42                 }
43                 if(detColor == 3)
44                 {
45                     block[i][j] = new BlueBlock;
46                 }
47                 if(detColor == 4)
48                 {
49                     block[i][j] = new MagentaBlock;
50                 }
51                 if(detColor == 5)
52                 {
53                     block[i][j] = new YellowBlock;
54                 }
55 
56                 block[i][j]->setXPos(xPos);
57                 block[i][j]->setYPos(yPos);
58                 block[i][j]->scale(1.0, 1.0);
59                 block[i][j]->setPos(xPos, yPos);
60                 xPos += BLOCKW + SPACE;
61                 theScene->addItem(block[i][j]);
62             }
63         }
64 
65         yPos += BLOCKH + SPACE;
66         xPos = -380 + (BOUNDWIDTH - 25 * OUTLINEW)/4;
67     }
68 }
\end{DoxyCode}


\subsection{Member Function Documentation}
\hypertarget{class_level_five_ab9b179447ae7546beec7e7e9936e0178}{
\index{LevelFive@{LevelFive}!boundingRect@{boundingRect}}
\index{boundingRect@{boundingRect}!LevelFive@{LevelFive}}
\subsubsection[{boundingRect}]{\setlength{\rightskip}{0pt plus 5cm}QRectF LevelFive::boundingRect () const\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_ab9b179447ae7546beec7e7e9936e0178}


Definition at line 70 of file levelFive.cpp.


\begin{DoxyCode}
71 {
72     return QRectF(375, 625, BOUNDWIDTH, BOUNDHEIGHT);
73 }
\end{DoxyCode}
\hypertarget{class_level_five_a15a3c882b6f2c4f645cd627e72cd7410}{
\index{LevelFive@{LevelFive}!generateRandomNumber@{generateRandomNumber}}
\index{generateRandomNumber@{generateRandomNumber}!LevelFive@{LevelFive}}
\subsubsection[{generateRandomNumber}]{\setlength{\rightskip}{0pt plus 5cm}int LevelFive::generateRandomNumber (int {\em min}, \/  int {\em max})\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_a15a3c882b6f2c4f645cd627e72cd7410}
Given a min and a max, generate a random number between this range 

Definition at line 88 of file levelFive.cpp.


\begin{DoxyCode}
89 {
90     return rand() % (max - min + 1) + min;
91 }
\end{DoxyCode}
\hypertarget{class_level_five_a128669075332c352f423e6e7892c9370}{
\index{LevelFive@{LevelFive}!paint@{paint}}
\index{paint@{paint}!LevelFive@{LevelFive}}
\subsubsection[{paint}]{\setlength{\rightskip}{0pt plus 5cm}void LevelFive::paint (QPainter $\ast$ {\em painter}, \/  const QStyleOptionGraphicsItem $\ast$ {\em option}, \/  QWidget $\ast$ {\em widget} = {\ttfamily 0})\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_a128669075332c352f423e6e7892c9370}


Definition at line 75 of file levelFive.cpp.


\begin{DoxyCode}
78 {
79     Q_UNUSED(painter);
80     Q_UNUSED(option);
81     Q_UNUSED(widget);
82 }
\end{DoxyCode}


\subsection{Member Data Documentation}
\hypertarget{class_level_five_acb6899f56afdf5b54ee0b078114dccdb}{
\index{LevelFive@{LevelFive}!block@{block}}
\index{block@{block}!LevelFive@{LevelFive}}
\subsubsection[{block}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Block}$\ast$ {\bf LevelFive::block}\mbox{[}10\mbox{]}\mbox{[}25\mbox{]}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_acb6899f56afdf5b54ee0b078114dccdb}


Definition at line 22 of file levelFive.h.\hypertarget{class_level_five_a49d0735f7e21868c1c128bd682cb60e0}{
\index{LevelFive@{LevelFive}!xPos@{xPos}}
\index{xPos@{xPos}!LevelFive@{LevelFive}}
\subsubsection[{xPos}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf LevelFive::xPos}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_a49d0735f7e21868c1c128bd682cb60e0}


Definition at line 21 of file levelFive.h.\hypertarget{class_level_five_aef7da49944f2c0192e80f54c427a5db9}{
\index{LevelFive@{LevelFive}!yPos@{yPos}}
\index{yPos@{yPos}!LevelFive@{LevelFive}}
\subsubsection[{yPos}]{\setlength{\rightskip}{0pt plus 5cm}int {\bf LevelFive::yPos}\hspace{0.3cm}{\ttfamily  \mbox{[}private\mbox{]}}}}
\label{class_level_five_aef7da49944f2c0192e80f54c427a5db9}


Definition at line 21 of file levelFive.h.

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
C:/Users/Kohli/Desktop/Earth-\/20000/\hyperlink{level_five_8h}{levelFive.h}\item 
C:/Users/Kohli/Desktop/Earth-\/20000/\hyperlink{level_five_8cpp}{levelFive.cpp}\end{DoxyCompactItemize}
